import {
  AxiosRequestConfig,
  AxiosResponse,
  InternalAxiosRequestConfig
} from 'axios'

// isTranformRequest

export interface RequestInterceptors<T = any> {
  requestInterceptor?: (
    config: InternalAxiosRequestConfig
  ) => InternalAxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (response: T) => AxiosResponse<T>
  responseInterceptorCatch?: (error: any) => any
}

export interface extraConfig {
  isTranformRequest?: boolean
}

export interface RequestConfig<T = any> extends AxiosRequestConfig {
  interceptors?: RequestInterceptors<T>
}
